import { getCurrentInstance } from 'vue'
import { IMessage } from 'element-plus/lib/el-message/src/types'

type IUseMessage = () => IMessage

export const useMessage: IUseMessage = () => {
  const { proxy } = getCurrentInstance()!
  const message = proxy!.$message
  return message
}
